<cfcomponent output="false">
	<cfset $ = application.helpers />
	
	<!--- --->
	
	<cffunction name="getMailings" access="public" output="true" returntype="query">
		<cfargument name="fundID" required="true" />
		
		<cfquery name="local.getMailings" datasource="fundrdb">
			select hex(fund_mailing.id) as id,
			fund_mailing.name,
			fund_mailing.subject,
			fund_mailing.email_from,
			fund_mailing.body
			from fund_mailing
			where fund_mailing.active = 1
			and fund_mailing.fund_id = #$.database.uuid(arguments.fundID)#
			order by created desc
		</cfquery>
		
		<cfreturn local.getMailings />
		
	</cffunction>
	
	<!--- --->

</cfcomponent>